package com.atguigu.jxc.service.impl;/*
 *@author 尹凯瑞
 *@date 2020/12/4 11:15
 */

import com.atguigu.jxc.dao.UnitDao;
import com.atguigu.jxc.entity.Unit;
import com.atguigu.jxc.service.UnitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class UnitServiceImpl implements UnitService {
    @Autowired
    private UnitDao unitDao;
    @Override
    public Map<String, Object> getAllUnit() {
        //创建集合保存前端页面需要的信息
        Map<String, Object> map = new HashMap<>();
        //查询所有单位信息
        List<Unit> unitList =  unitDao.getAllUnit();
        //封装数据到集合
        map.put("rows",unitList);
        //返回
        return map;

    }
}
